#include <iostream>

#include "MetadataSvr.h"

using std::cout;
using std::endl;

int g_my_mds_id;
string g_log_conf_file;

int parse_args(int argc, char * argv[]) {
        char c;
        while(-1 != (c = getopt(argc, argv, "i:l:"))) {
                switch(c) {
                        case 'i':
                                g_my_mds_id = atoi(optarg);
                                break;
                        case 'l':
                                g_log_conf_file = optarg;
                                break;

                        default:
                                break;
                }
        }
}

int main(int argc, char * argv[]) {
	parse_args(argc, argv);
	MetadataSvr mds;
	int ret = mds.init(g_log_conf_file.c_str(), g_my_mds_id, "127.0.0.1", 3501, 30, 2, 10, 10, -1);
	if (ret < 0) {
		cout << "could not init metadata svr, ret:" << ret << endl;
		return -1;
	}
	mds.start();
}
